<div class="portlet box green">
	<div class="portlet-title">
	    <div class="caption"><i class="fa fa-cog"></i>账房 > 收支查询 > 订单明细 </div>
		<div class="tools">
			<a href="javascript:;" class="collapse right" data-original-title="" title=""> </a>
    	</div>
    	<div class="actions">
			<a href="javascript:;" class="btn white btn-sm ajax-search"><i class="fa fa-search"></i> 查询 </a>
			<a href="javascript:;" class="btn white btn-sm search-reset"><i class="fa fa-eraser"></i> 清除 </a>
		</div>
	</div>
	<div class="portlet-body form">
	   	<form action="/order/reveExpenList" class="form-horizontal" method="get" id="searchForm">
			<div class="form-body">
				<div class="row">
					<div class="form-group">
						注：订单总额 = 货品总额 + 运费 - 优惠减免金额；  终送出积分数 = 送出积分数 - 扣除积分数（指的是卖家送给买家的，买家售后退款会对应扣除）;
					</div>
					<div class="form-group">
						<div class="col-md-3">
							<label class="col-md-4 control-label">订单号：</label>
							<div class="col-md-8">
						    	<input type="text" class="form-control" name="id" value="$!id">
							</div>
						</div>
						<div class="col-md-3">
							<label class="col-md-4 control-label">所属企业：</label>
							<div class="col-md-8">
						    	<input type="text" class="form-control" name="company" value="$!company">
							</div>
						</div>
						<div class="col-md-3">
							<label class="control-label col-md-4">付款日期：</label> 
							<label class="col-md-8">
								<input class="form-control" type="text" name="startTime" id="startTime" value="$!startTime" readonly>
								<i class="fa fa-calendar" style="position: absolute;right: 10px;top: 10px"></i>
							</label>
						</div>
						<div class="col-md-3">
							<label class="control-label col-md-2">至：</label> 
							<label class="col-md-8">
								<input class="form-control" type="text" name="endTime" id="endTime" value="$!endTime" readonly>
								<i class="fa fa-calendar" style="position: absolute;right: 10px;top: 10px"></i>
							</label>
						</div>
					</div>
	    		</div>
			</div>
		</form>
	</div>
</div>

<div class="portlet box green">
    <div class="portlet-title">
		<div class="caption"><i class="fa fa-cogs"></i>数据列表</div>
		<div class="tools"><a href="javascript:;" class="collapse" data-original-title="" title=""> </a></div>
		<div class="actions">
			<a  id="export" class="btn white btn-sm"  ><i class="fa fa-cloud-download"></i> 导出 </a>
		</div>
    </div>
    <div class="portlet-body">
    	<div class="dataTables_wrapper no-footer">
			<div class="table-scrollable">
			    <table class="table table-striped table-bordered table-hover icheck-table">
				  	<thead>
						<tr>
							<th style="width: 20px">
								<input type="checkbox" class="icheck group-icheck" />
							</th>
							<th>订单号</th>
		   		 			<th>订单状态</th>
		   		 			<th>订单总额(￥)</th>
		   		 			<th>货品总额(￥)</th>
		   		 			<th>运费(￥)</th>
		   		 			<th>优惠减免金额(￥)</th>
		   		 			<th>送出积分数</th>
		   		 			<th>付款时间</th>
							<th>退款金额(￥)</th>
							<th>扣除积分数</th>
		   		 			<th>所属企业</th>
							<th>所属会员</th>
						</tr>
					</thead>
					<tbody>
					#foreach($item in $pageOrder.result)
		  				<tr>
		  					<td>
								<input type="checkbox" name="checkboxes" class="icheck" value="$!item.id" />
							</td>  
						    <td>$!item.id</td>
						    <td>$!item.orderState.name</td>
						    <td>$!item.total</td>
						    <td>$!item.productFee</td>
						    <td>$!item.deliverFee</td>
						    <td>$!item.couponReduction</td>
						    <td>$!item.xx</td>
						    <td>$!item.payTimeString</td>
						    <td>$!item.xx</td>
						    <td>$!item.xx</td>
						    <td>$!item.company</td>
						    <td>$!item.username</td>	  			
		  				</tr>
					#end
					</tbody>
				</table>
			</div>
			#set($page=$pageOrder)
			#set($pageUrl="/order/reveExpenList?&pageNo=")
			#parse("_page.htm")
		</div>
	</div>
		<form id="excel_download" action="/order/exportExcel" class="hide" method="POST">
			<input type="hidden" name="oId" id="oId">
			<button type="submit"></button>
		</form>
</div>
<script src="/assets/scripts/views-date.js" type="text/javascript"></script>
<script type="text/javascript" src="/assets/scripts/views-icheck.js"></script>
<script type="text/javascript">
/**
 * 导出报价单
 */
$("#export").click(function(){
	var array = new Array()
	var target= $("input[name='checkboxes']");
	//循环加入数组
	
		$.each(target,function(i,v){
			if(v.checked){
				array.push($(v).val());
			}
		});
	if(array.length>0){
		$("#oId").val(array);
		$("#excel_download").submit();
	}else{
		toastr.warning("请勾选要导出的发货单！");
	}
})
</script>